<%-- 
    Document   : login
    Created on : Jun 10, 2013, 11:07:07 AM
    Author     : Huong
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <h1>
            Project Management
        </h1>
        <form method="post">
            <table>
                <tr>
                    <td>
                        <b>Login</b>
                    </td>
                </tr>
                <tr>
                    <td>
                        User name
                    </td>
                    <td>
                        <input type="text" name="name" />
                    </td>
                </tr>
                <tr>
                    <td>
                        Password
                    </td>
                    <td>
                        <input type="text" name="password"/>
                    </td>
                </tr>
                <tr>
                    <td>
                        <input type="checkbox" name=""/>
                        Remember me
                    </td>
                </tr>
                <tr>
                    <td>
                    <td>
                        <input type="submit" value="Login" />

                    </td>
                </tr>
            </table>
        </form>

        <jsp:useBean id = "user" class ="myBean.User"/>
        <jsp:setProperty name="student" property="*"/>

        <%
            boolean available = user.available();
            if (available) {
                RequestDispatcher dispatcher = request.getRequestDispatcher("/project.jsp");
                dispatcher.forward(request, response);
            } else{
                RequestDispatcher dispatcher = request.getRequestDispatcher("/login.jsp");
                        dispatcher.forward(request, response);
            }
          
        %>
    </body>
</html>
